﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SketlonBackOffice
{
    public static class ExtensionMethods
    {
        /// <summary>
        /// Adjusts the line exit to the middle
        /// </summary>
        /// <param name="value">double val</param>
        /// <param name="lineDirection">line exit direction. 1 :up 2:down 3:left 4:right</param>
        /// <returns></returns>
        public static double AdjustCenterX(this double value)
        {
          
                return Math.Floor(value +7);
        }

        /// <summary>
        /// Adjusts the line exit to the middle
        /// </summary>
        /// <param name="value">double val</param>
        /// <param name="lineDirection">line exit direction. 1 :up 2:down 3:left 4:right</param>
        /// <returns></returns>
        public static double AdjustCenterY(this double value)
        {
            return Math.Floor(value + 7);
        }

        public static int ToInt(this object value)
        {

            return Convert.ToInt32(value);
        }

        public static double ToFloor(this double value)
        {

            return Math.Floor(value);
        }

        public static double ToCeiling(this double value)
        {

            return Math.Ceiling(value);
        }
        public static bool ToBool(this object value)
        {

            return Convert.ToBoolean(value);
        }
    }
}
